import { request } from '@/utils';

/**
 * 付费用户授权
 * @param {*} data
 * activityId 活动id
 */
export function initPayUser(data) {
  return request({
    url: `/payUser/initPayUser`,
    method: 'post',
    data,
  });
}
/**
 * 购买部署密钥
 * @param {*} data
 * username
 */
export function buyDeployKey(data) {
  return request({
    url: `/payment/buyDeployKey`,
    method: 'post',
    data,
  });
}
/**
 * 部署企业的付费历史
 * @param {*} companyName
 * companyName 部署企业名称
 */
export function companyPayOrders(companyName) {
  return request({
    url: `/payment/companyPayOrders`,
    method: 'get',
    data: { companyName },
  });
}

/**
 * 我购买部署的企业
 * @param {*} void
 */
export function myPayOrders() {
  return request({
    url: `/payment/myPayOrders`,
    method: 'get',
  });
}
/**
 * 部署详情
 * @param {*} companyName
 * businessOrderNumber 购买企业名称
 */
export function payOrderInfo(companyName) {
  return request({
    url: `/payment/payOrderInfo`,
    method: 'get',
    data: {
      companyName,
    },
  });
}

/**
 * 续费部署密钥
 * @param {*} data
 *
 */
export function renewalDeployKey(data) {
  return request({
    url: `/payment/renewalDeployKey`,
    method: 'post',
    data,
  });
}

/**
 * 获取当前所属企业信息
 * @param {*} corpId
 */
export function getBusinessInfo(corpId) {
  return request({
    url: `/payment/getBusinessInfo`,
    method: 'get',
    showLoading: false,
    data: { corpId },
  });
}
/**
 * 获取订单支付结果
 * @param {*} payOrderNumber
 */
export function getPayOrderPayResult(payOrderNumber) {
  return request({
    url: `/payment/getPayOrderPayResult`,
    method: 'get',
    data: { payOrderNumber },
  });
}
/**
 * 获取客服二维码
 * @param {*} void
 */
export function getCustomerQrcode() {
  return request({
    url: `/payment/getCustomerQrcode`,
    method: 'get',
  });
}
